home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat2 / standard / stat.z / stat
Encoding:
Text File  |  2001-04-17  |  22.4 KB  |  265 lines

  1.  
  2.  
  3.  
  4. ssssttttaaaatttt((((2222))))                                                                ssssttttaaaatttt((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      stat, lstat, fstat - get file status
  10.  
  11. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_ssss_tttt_aaaa_tttt_...._hhhh_>>>>
  14.  
  15.      _iiii_nnnn_tttt _ssss_tttt_aaaa_tttt_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_p_a_t_h_,,,, _ssss_tttt_rrrr_uuuu_cccc_tttt _ssss_tttt_aaaa_tttt _****_b_u_f_))))_;;;;
  16.  
  17.      _iiii_nnnn_tttt _llll_ssss_tttt_aaaa_tttt_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_p_a_t_h_,,,, _ssss_tttt_rrrr_uuuu_cccc_tttt _ssss_tttt_aaaa_tttt _****_b_u_f_))))_;;;;
  18.  
  19.      _iiii_nnnn_tttt _ffff_ssss_tttt_aaaa_tttt_((((_iiii_nnnn_tttt _f_i_l_d_e_s_,,,, _ssss_tttt_rrrr_uuuu_cccc_tttt _ssss_tttt_aaaa_tttt _****_b_u_f_))))_;;;;
  20.  
  21. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  22.      The only difference between the _****_ssss_tttt_aaaa_tttt and the _****_ssss_tttt_aaaa_tttt_6666_4444 calls is that the
  23.      _****_ssss_tttt_aaaa_tttt_6666_4444 calls return a _ssss_tttt_aaaa_tttt_6666_4444 structure, with three fields increased in
  24.      size to allow for larger files and filesystems:  _ssss_tttt______iiii_nnnn_oooo, _ssss_tttt______ssss_iiii_zzzz_eeee, and
  25.      _ssss_tttt______bbbb_llll_oooo_cccc_kkkk_ssss are all 64-bit values.
  26.  
  27.      NOTE:  All programs compiled either -n32 or -64 get the _ssss_tttt_aaaa_tttt_6666_4444 versions
  28.      of the stat system call, even when calling _ssss_tttt_aaaa_tttt.  Only programs compiled
  29.      -o32 get the version with the smaller field sizes, for binary
  30.      compatibility.
  31.  
  32.      _p_a_t_h points to a path name naming a file.  Read, write, or execute
  33.      permission of the named file is not required, but all directories listed
  34.      in the path name leading to the file must be searchable.  _ssss_tttt_aaaa_tttt obtains
  35.      information about the named file.
  36.  
  37.      _llll_ssss_tttt_aaaa_tttt obtains file attributes similar to _ssss_tttt_aaaa_tttt, except when the named file
  38.      is a symbolic link; in that case _llll_ssss_tttt_aaaa_tttt returns information about the
  39.      link, while _ssss_tttt_aaaa_tttt returns information about the file the link references.
  40.  
  41.      _ffff_ssss_tttt_aaaa_tttt obtains information about an open file known by the file descriptor
  42.      _f_i_l_d_e_s, obtained from a successful _cccc_rrrr_eeee_aaaa_tttt, _oooo_pppp_eeee_nnnn, _dddd_uuuu_pppp, _ffff_cccc_nnnn_tttt_llll, _pppp_iiii_pppp_eeee, or
  43.      _iiii_oooo_cccc_tttt_llll system call.
  44.  
  45.      _b_u_f is a pointer to a _ssss_tttt_aaaa_tttt structure into which information is placed
  46.      concerning the file.
  47.  
  48.      The contents of the structure pointed to by _b_u_f include the following
  49.      members:
  50.  
  51.         _mmmm_oooo_dddd_eeee______tttt         _ssss_tttt______mmmm_oooo_dddd_eeee_;;;;     _////_**** _FFFF_iiii_llll_eeee _mmmm_oooo_dddd_eeee _****_////
  52.         _iiii_nnnn_oooo______tttt          _ssss_tttt______iiii_nnnn_oooo_;;;;      _////_**** _IIII_nnnn_oooo_dddd_eeee _nnnn_uuuu_mmmm_bbbb_eeee_rrrr _****_////
  53.         _dddd_eeee_vvvv______tttt          _ssss_tttt______dddd_eeee_vvvv_;;;;      _////_**** _IIII_DDDD _oooo_ffff _dddd_eeee_vvvv_iiii_cccc_eeee _cccc_oooo_nnnn_tttt_aaaa_iiii_nnnn_iiii_nnnn_gggg _****_////
  54.                                     _////_**** _aaaa _dddd_iiii_rrrr_eeee_cccc_tttt_oooo_rrrr_yyyy _eeee_nnnn_tttt_rrrr_yyyy _ffff_oooo_rrrr _tttt_hhhh_iiii_ssss _ffff_iiii_llll_eeee _****_////
  55.         _dddd_eeee_vvvv______tttt          _ssss_tttt______rrrr_dddd_eeee_vvvv_;;;;     _////_**** _IIII_DDDD _oooo_ffff _dddd_eeee_vvvv_iiii_cccc_eeee _****_////
  56.                                     _////_**** _TTTT_hhhh_iiii_ssss _eeee_nnnn_tttt_rrrr_yyyy _iiii_ssss _dddd_eeee_ffff_iiii_nnnn_eeee_dddd _oooo_nnnn_llll_yyyy _ffff_oooo_rrrr _****_////
  57.                                     _////_**** _cccc_hhhh_aaaa_rrrr _ssss_pppp_eeee_cccc_iiii_aaaa_llll_,,,, _bbbb_llll_oooo_cccc_kkkk _ssss_pppp_eeee_cccc_iiii_aaaa_llll_,,,, _****_////
  58.                                     _////_**** _aaaa_nnnn_dddd _llll_oooo_ffff_ssss _ffff_iiii_llll_eeee_ssss _****_////
  59.         _nnnn_llll_iiii_nnnn_kkkk______tttt        _ssss_tttt______nnnn_llll_iiii_nnnn_kkkk_;;;;    _////_**** _NNNN_uuuu_mmmm_bbbb_eeee_rrrr _oooo_ffff _llll_iiii_nnnn_kkkk_ssss _****_////
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssttttaaaatttt((((2222))))                                                                ssssttttaaaatttt((((2222))))
  71.  
  72.  
  73.  
  74.         _uuuu_iiii_dddd______tttt          _ssss_tttt______uuuu_iiii_dddd_;;;;      _////_**** _UUUU_ssss_eeee_rrrr _IIII_DDDD _oooo_ffff _tttt_hhhh_eeee _ffff_iiii_llll_eeee_''''_ssss _oooo_wwww_nnnn_eeee_rrrr _****_////
  75.         _gggg_iiii_dddd______tttt          _ssss_tttt______gggg_iiii_dddd_;;;;      _////_**** _GGGG_rrrr_oooo_uuuu_pppp _IIII_DDDD _oooo_ffff _tttt_hhhh_eeee _ffff_iiii_llll_eeee_''''_ssss _gggg_rrrr_oooo_uuuu_pppp _****_////
  76.         _oooo_ffff_ffff______tttt          _ssss_tttt______ssss_iiii_zzzz_eeee_;;;;     _////_**** _FFFF_iiii_llll_eeee _ssss_iiii_zzzz_eeee _iiii_nnnn _bbbb_yyyy_tttt_eeee_ssss _****_////
  77.         _tttt_iiii_mmmm_eeee_ssss_pppp_eeee_cccc______tttt     _ssss_tttt______aaaa_tttt_iiii_mmmm_;;;;     _////_**** _TTTT_iiii_mmmm_eeee _oooo_ffff _llll_aaaa_ssss_tttt _aaaa_cccc_cccc_eeee_ssss_ssss _****_////
  78.         _tttt_iiii_mmmm_eeee_ssss_pppp_eeee_cccc______tttt     _ssss_tttt______mmmm_tttt_iiii_mmmm_;;;;     _////_**** _TTTT_iiii_mmmm_eeee _oooo_ffff _llll_aaaa_ssss_tttt _dddd_aaaa_tttt_aaaa _mmmm_oooo_dddd_iiii_ffff_iiii_cccc_aaaa_tttt_iiii_oooo_nnnn _****_////
  79.         _tttt_iiii_mmmm_eeee_ssss_pppp_eeee_cccc______tttt     _ssss_tttt______cccc_tttt_iiii_mmmm_;;;;     _////_**** _TTTT_iiii_mmmm_eeee _oooo_ffff _llll_aaaa_ssss_tttt _ffff_iiii_llll_eeee _ssss_tttt_aaaa_tttt_uuuu_ssss _cccc_hhhh_aaaa_nnnn_gggg_eeee _****_////
  80.                                     _////_**** _TTTT_iiii_mmmm_eeee_ssss _mmmm_eeee_aaaa_ssss_uuuu_rrrr_eeee_dddd _iiii_nnnn _ssss_eeee_cccc_oooo_nnnn_dddd_ssss _aaaa_nnnn_dddd _nnnn_aaaa_nnnn_oooo_ssss_eeee_cccc_oooo_nnnn_dddd_ssss _****_////
  81.                                     _////_**** _ssss_iiii_nnnn_cccc_eeee _0000_0000_::::_0000_0000_::::_0000_0000 _UUUU_TTTT_CCCC_,,,, _JJJJ_aaaa_nnnn_.... _1111_,,,, _1111_9999_7777_0000 _****_////
  82.         _llll_oooo_nnnn_gggg           _ssss_tttt______bbbb_llll_kkkk_ssss_iiii_zzzz_eeee_;;;;  _////_**** _PPPP_rrrr_eeee_ffff_eeee_rrrr_rrrr_eeee_dddd _IIII_////_OOOO _bbbb_llll_oooo_cccc_kkkk _ssss_iiii_zzzz_eeee _****_////
  83.         _bbbb_llll_kkkk_cccc_nnnn_tttt______tttt       _ssss_tttt______bbbb_llll_oooo_cccc_kkkk_ssss_;;;;   _////_**** _NNNN_uuuu_mmmm_bbbb_eeee_rrrr _5555_1111_2222 _bbbb_yyyy_tttt_eeee _bbbb_llll_oooo_cccc_kkkk_ssss _aaaa_llll_llll_oooo_cccc_aaaa_tttt_eeee_dddd _****_////
  84.  
  85.      The fields have the following meanings:
  86.  
  87.      _ssss_tttt______mmmm_oooo_dddd_eeee   The mode of the file as described in _mmmm_kkkk_nnnn_oooo_dddd(2).  In addition to
  88.                the modes described in _mmmm_kkkk_nnnn_oooo_dddd(2), the mode of a file may also be
  89.                S_IFLNK if the file is a symbolic link.  (Note that S_IFLNK may
  90.                only be returned by _llll_ssss_tttt_aaaa_tttt.)  The various macros in _ssss_yyyy_ssss_////_ssss_tttt_aaaa_tttt_...._hhhh
  91.                should be used to determine if there is a type match, since the
  92.                types are not a bit field.  For example, you should use
  93.                _SSSS______IIII_SSSS_DDDD_IIII_RRRR_((((_ssss_tttt_...._ssss_tttt______mmmm_oooo_dddd_eeee_)))) rather than _((((_ssss_tttt_...._ssss_tttt______mmmm_oooo_dddd_eeee_&&&&_SSSS______IIII_FFFF_DDDD_IIII_RRRR_)))).
  94.  
  95.      _ssss_tttt______iiii_nnnn_oooo    Except for lofs file systems this field uniquely identifies the
  96.                file in a given file system and the pair _ssss_tttt______iiii_nnnn_oooo and _ssss_tttt______dddd_eeee_vvvv
  97.                uniquely identify regular files and directories. For regular
  98.                files and directories accessed via an "lofs" file system, the
  99.                value of this field is obtained from the underlying file
  100.                system, and the _ssss_tttt______rrrr_dddd_eeee_vvvv field must also be used to identify
  101.                uniqueness.
  102.  
  103.      _ssss_tttt______dddd_eeee_vvvv    Except for lofs file systems this field uniquely identifies the
  104.                file system that contains the file. Beware that this is still
  105.                true for NFS file systems exported using the -nohide option,
  106.                which may not appear in /etc/mtab. [See _eeee_xxxx_pppp_oooo_rrrr_tttt_ssss(4).]  Its value
  107.                may be used as input to the _uuuu_ssss_tttt_aaaa_tttt system call to determine more
  108.                information about this file system.  No other meaning is
  109.                associated with this value.  For regular files and directories
  110.                accessed via an "lofs" file system, the value of this field is
  111.                obtained from the underlying file system, and the _ssss_tttt______rrrr_dddd_eeee_vvvv field
  112.                must also be used to identify uniqueness.
  113.  
  114.      _ssss_tttt______rrrr_dddd_eeee_vvvv   This field should be used only by administrative commands.  It
  115.                is valid only for block special, character special, and files
  116.                and directories accessed via "lofs" file systems. It only has
  117.                meaning on the system where the file was configured.
  118.  
  119.      _ssss_tttt______nnnn_llll_iiii_nnnn_kkkk  This field should be used only by administrative commands.
  120.  
  121.      _ssss_tttt______uuuu_iiii_dddd    The user ID of the file's owner.
  122.  
  123.      _ssss_tttt______gggg_iiii_dddd    The group ID of the file's group.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ssssttttaaaatttt((((2222))))                                                                ssssttttaaaatttt((((2222))))
  137.  
  138.  
  139.  
  140.      _ssss_tttt______ssss_iiii_zzzz_eeee   For regular files, this is the address of the end of the file.
  141.                If the file's size is larger than will fit in the _ssss_tttt______ssss_iiii_zzzz_eeee field
  142.                (2^31 - 1) then the value (2^31 - 1) is returned there instead.
  143.                See also _ssss_tttt_aaaa_tttt_6666_4444(2).  For block special or character special,
  144.                this is not defined.  See also _pppp_iiii_pppp_eeee(2).
  145.  
  146.      _ssss_tttt______aaaa_tttt_iiii_mmmm   Time when file data was last accessed.  Changed by the
  147.                following system calls:  _cccc_rrrr_eeee_aaaa_tttt, _mmmm_kkkk_nnnn_oooo_dddd, _pppp_iiii_pppp_eeee, _uuuu_tttt_iiii_mmmm_eeee, and _rrrr_eeee_aaaa_dddd.
  148.                The seconds portion of _ssss_tttt______aaaa_tttt_iiii_mmmm is available as _ssss_tttt______aaaa_tttt_iiii_mmmm_eeee.
  149.  
  150.      _ssss_tttt______mmmm_tttt_iiii_mmmm   Time when data was last modified.  Changed by the following
  151.                system calls:  _cccc_rrrr_eeee_aaaa_tttt, _mmmm_kkkk_nnnn_oooo_dddd, _pppp_iiii_pppp_eeee, _uuuu_tttt_iiii_mmmm_eeee, and _wwww_rrrr_iiii_tttt_eeee.  The
  152.                seconds portion of _ssss_tttt______mmmm_tttt_iiii_mmmm is available as _ssss_tttt______mmmm_tttt_iiii_mmmm_eeee.
  153.  
  154.      _ssss_tttt______cccc_tttt_iiii_mmmm   Time when file status was last changed.  Changed by the
  155.                following system calls:  _cccc_hhhh_mmmm_oooo_dddd, _cccc_hhhh_oooo_wwww_nnnn, _cccc_rrrr_eeee_aaaa_tttt, _llll_iiii_nnnn_kkkk, _mmmm_kkkk_nnnn_oooo_dddd,
  156.                _pppp_iiii_pppp_eeee, _uuuu_nnnn_llll_iiii_nnnn_kkkk, _uuuu_tttt_iiii_mmmm_eeee, and _wwww_rrrr_iiii_tttt_eeee.  The seconds portion of _ssss_tttt______cccc_tttt_iiii_mmmm
  157.                is available as _ssss_tttt______cccc_tttt_iiii_mmmm_eeee.
  158.  
  159.      _ssss_tttt______bbbb_llll_kkkk_ssss_iiii_zzzz_eeee
  160.                A hint as to the ``best'' unit size for I/O operations.  If the
  161.                underlying volume is a stripe volume, then st_blksize is set to
  162.                the stripe width.  This field is not defined for block-special
  163.                or character-special files.
  164.  
  165.      _ssss_tttt______bbbb_llll_oooo_cccc_kkkk_ssss The total number of physical blocks of size 512 bytes actually
  166.                allocated on disk.  This field is not defined for block-special
  167.                or character-special files.  Holes in files (blocks never
  168.                allocated) are not counted in this value; indirect blocks
  169.                (those used to store pointers to blocks in the file) are
  170.                counted.
  171.  
  172.      _ssss_tttt_aaaa_tttt and _llll_ssss_tttt_aaaa_tttt fail if one or more of the following are true:
  173.  
  174.      _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS    Search permission is denied for a component of the path prefix.
  175.  
  176.      _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT    _b_u_f or _p_a_t_h points to an invalid address.
  177.  
  178.      _EEEE_IIII_NNNN_TTTT_RRRR     A signal was caught during the _ssss_tttt_aaaa_tttt or _llll_ssss_tttt_aaaa_tttt system call.
  179.  
  180.      _EEEE_TTTT_IIII_MMMM_EEEE_DDDD_OOOO_UUUU_TTTT The named file is located on a remote file system which is not
  181.                available [see _iiii_nnnn_tttt_rrrr_oooo(2)].
  182.  
  183.      _EEEE_LLLL_OOOO_OOOO_PPPP     Too many symbolic links were encountered in translating _p_a_t_h.
  184.  
  185.      _EEEE_MMMM_UUUU_LLLL_TTTT_IIII_HHHH_OOOO_PPPP Components of _p_a_t_h require hopping to multiple remote machines
  186.                and the file system does not allow it.
  187.  
  188.      _EEEE_NNNN_AAAA_MMMM_EEEE_TTTT_OOOO_OOOO_LLLL_OOOO_NNNN_GGGG
  189.                The length of the _p_a_t_h argument exceeds {_PPPP_AAAA_TTTT_HHHH______MMMM_AAAA_XXXX}, or the
  190.                length of a _p_a_t_h component exceeds {_NNNN_AAAA_MMMM_EEEE______MMMM_AAAA_XXXX} while
  191.                ______PPPP_OOOO_SSSS_IIII_XXXX______NNNN_OOOO______TTTT_RRRR_UUUU_NNNN_CCCC is in effect.
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ssssttttaaaatttt((((2222))))                                                                ssssttttaaaatttt((((2222))))
  203.  
  204.  
  205.  
  206.      _EEEE_NNNN_OOOO_EEEE_NNNN_TTTT    The named file does not exist or is the null pathname.
  207.  
  208.      _EEEE_NNNN_OOOO_TTTT_DDDD_IIII_RRRR   A component of the path prefix is not a directory.
  209.  
  210.      _EEEE_NNNN_OOOO_LLLL_IIII_NNNN_KKKK   _p_a_t_h points to a remote machine and the link to that machine is
  211.                no longer active.
  212.  
  213.      _EEEE_OOOO_VVVV_EEEE_RRRR_FFFF_LLLL_OOOO_WWWW A component is too large to store in the structure pointed to
  214.                by _b_u_f.
  215.  
  216.      _ffff_ssss_tttt_aaaa_tttt fails if one or more of the following are true:
  217.  
  218.      _EEEE_BBBB_AAAA_DDDD_FFFF     _f_i_l_d_e_s is not a valid open file descriptor.
  219.  
  220.      _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT    _b_u_f points to an invalid address.
  221.  
  222.      _EEEE_IIII_NNNN_TTTT_RRRR     A signal was caught during the _ffff_ssss_tttt_aaaa_tttt system call.
  223.  
  224.      _EEEE_TTTT_IIII_MMMM_EEEE_DDDD_OOOO_UUUU_TTTT _f_i_l_d_e_s refers to a file on a remote file system which is not
  225.                available [see _iiii_nnnn_tttt_rrrr_oooo(2)].
  226.  
  227.      _EEEE_NNNN_OOOO_LLLL_IIII_NNNN_KKKK   _f_i_l_d_e_s refers to a file on a remote machine and the link to
  228.                that machine is no longer active.
  229.  
  230.      _EEEE_OOOO_VVVV_EEEE_RRRR_FFFF_LLLL_OOOO_WWWW A component is too large to store in the structure pointed to
  231.                by _b_u_f.
  232.  
  233. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  234.      _cccc_hhhh_mmmm_oooo_dddd(2), _cccc_hhhh_oooo_wwww_nnnn(2), _cccc_rrrr_eeee_aaaa_tttt(2), _eeee_xxxx_pppp_oooo_rrrr_tttt_ssss(4), _ffff_aaaa_tttt_tttt_aaaa_cccc_hhhh(3C), _llll_iiii_nnnn_kkkk(2), _mmmm_kkkk_nnnn_oooo_dddd(2),
  235.      _pppp_iiii_pppp_eeee(2), _rrrr_eeee_aaaa_dddd(2), _ssss_tttt_aaaa_tttt_6666_4444(2), _rrrr_eeee_aaaa_llll_pppp_aaaa_tttt_hhhh(3C), _ssss_tttt_aaaa_tttt(5), _ssss_tttt_aaaa_tttt_6666_4444(5), _tttt_iiii_mmmm_eeee(2),
  236.      _uuuu_nnnn_llll_iiii_nnnn_kkkk(2), _uuuu_tttt_iiii_mmmm_eeee(2), _wwww_rrrr_iiii_tttt_eeee(2)
  237.  
  238. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  239.      Upon successful completion a value of 0 is returned.  Otherwise, a value
  240.      of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to indicate the error.
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.